﻿using System.Data;
using System.Drawing.Printing;

namespace Barkod
{
    public partial class KoliEtiketi : DevExpress.XtraReports.UI.XtraReport
    {
        DataTable dtSource;
        int type = 1;
        public KoliEtiketi(DataTable dtSource, int type)
        {
            InitializeComponent();
            this.dtSource = dtSource;
            this.type = type;
            if (type == 2)
                lbl.Text = "Model No.";
        }

        private void KoliEtiketi_BeforePrint(object sender, PrintEventArgs e)
        {

            DataSet ds = new DataSet("ds");
            ds.Tables.Add(dtSource);

            string name = "data";
            dtSource.TableName = name;
            this.DataMember = name;
            this.DataSource = ds;
            xrBarcode.DataBindings.Add("Text", null, name + ".Barkod");
            xrNo.DataBindings.Add("Text", null, name + ".Barkod");
        }

        private void Detail_BeforePrint(object sender, PrintEventArgs e)
        {
        }
    }
}
